@extends("layouts.app",['categories'=>$categories])

@section('title',$category->name??'全部帖子')

@section('content')

    <div class="row">
        <div class="col-md-9">

            @if(isset($category))
                <div class="accordion mb-2" id="accordionExample">
                    <div class="accordion-item">
                        <h2 class="accordion-header" id="headingOne">
                            <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                <i class="fa-solid fa-rss"></i>&nbsp;当前板块    ：    <b>{{$category->name}}</b>
                            </button>
                        </h2>
                        <div id="collapseOne" class="accordion-collapse collapse show bg-light" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
                            <div class="accordion-body">
                                <strong>{{$category->description}}</strong>
                            </div>
                        </div>
                    </div>
                </div>
            @endif



            <div class="card">
                <div class="card-header bg-transparent nav_topic">
                    <ul class="nav nav-tabs">
                        <li class="nav-item">
                            <a class="nav-link {{active_class(if_query('order','reply')||if_query('order',null))}}" aria-current="page" href="{{Request::url()}}?order=reply">最近评论</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{active_class(if_query('order','post'))}}" href="{{Request::url()}}?order=post">最近发帖</a>
                        </li>
                    </ul>
                </div>

                {{--帖子列表--}}
                @include('topics._topic_list',['topics'=>$topics])
            </div>

        </div>
        <div class="col-md-3">
            @include('topics._sidebar')
        </div>
    </div>

@stop
